package com.google.code.coma.space;

import org.mozartspaces.core.Capi;
import org.mozartspaces.core.DefaultMzsCore;
import org.mozartspaces.core.MzsCore;
import org.mozartspaces.core.remote.tcpsocket.TcpSocketSender;

/**
 * @author Dominik Strasser, dominikstr@gmail.com
 */
public class ServerLauncher {
	public static void main(String... args) {
		System.out.println("Starting up server using configuration file server.xml");
		System.setProperty("mozartspaces.configurationFile", "server.xml");
		final MzsCore core = DefaultMzsCore.newInstance(4242);
		Capi capi = new Capi(core);
		Runtime.getRuntime().addShutdownHook(new Thread() {
			@Override
			public void run() {
				core.shutdown(false);
				System.out.println(" [SHUTDOWN COMPLETE]");
			}
		});

		System.out.println("startup complete");
	}
}
